
// import { ideaBank } from "../../../../utils/data/tabbar";
import { expertListPage } from  "../../../../utils/api/module/cylm";
Page({
    data: {
        ideaBank: [],
        page: 1,
        isLineData: 0, // 显示加载
    },
    onLoad: function (options) {
        this.getData();
    },
    getData: function() {
        expertListPage({
            page: this.data.page,
            limit: 10
        }).then(res => {
            this.setData({
                ['ideaBank[' + (this.data.page - 1) + ']']: res.data.data.rows,
                isLineData: res.data.data.rows.length < 10 && this.data.page != 1 ? 2 : 0
            });
        })
    },
    onReachBottom: function() {
        if(this.data.ideaBank[(this.data.page - 1)].length < 10) {
            this.setData({ isLineData: 2 })
            return false;
        };
        this.setData({ isLineData: 1 })
        this.data.page += 1;
        this.getData();
    }
})